package com.code.day18;

import java.io.File;

public class Demo20FileLianXi {
    public static void main(String[] args) {
        File file = new File("D:\\java-code\\java-full-stack\\01-java-base\\src\\com\\code\\day19\\img");
        method(file);
    }

    public static void method(File file) {
        File[] files = file.listFiles();
        for (File file1 : files) {
            if (file1.isFile()) {
                String name = file1.getName();
                if (name.endsWith(".png")) {
                    System.out.println(name);
                }
            } else {
                method(file1);
            }
        }
    }

}
